import { defineStore } from 'pinia'

export const useComponentDataModelStore = defineStore('componentDataModel', {
  state: () => ({
    dataModelCache: {} as Record<string, any[]>
  }),
  actions: {
    getDataModel(componentId: string) {
      return this.dataModelCache[componentId] || null
    },
    setDataModel(componentId: string, data: any[]) {
      this.dataModelCache[componentId] = data
    },
    clearCache() {
      this.dataModelCache = {}
    }
  }
}) 